package com.imooc.ad.client;

import com.imooc.ad.client.vo.AdPlan;
import com.imooc.ad.client.vo.AdPlanGetRequest;
import com.imooc.ad.vo.CommonResponse;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName SponsorClientHystrix 断路器
 * Created by zghgchao 2019/3/26 23:30
 **/
@Component
public class SponsorClientHystrix implements SponsorClient{
    @Override
    public CommonResponse<List<AdPlan>> getAdPlans(AdPlanGetRequest request) {
        // 服务调不通时进行服务降级，使用这个实现
        return new CommonResponse<>(-1,"eureka-client-ad-sponsor error");
    }

    @Override
    public CommonResponse<Object> test() {
        return new CommonResponse<>(-1,"eureka-client-ad-sponsor error");
    }
}
